package com.chenfeng.ego.controller;
import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import com.chenfeng.ego.commons.pojo.EasyUIDataGrid;
import com.chenfeng.ego.commons.pojo.EasyUiTree;
import com.chenfeng.ego.commons.pojo.EgoResult;
import com.chenfeng.ego.service.TbItemCatService;


@Controller
public class TbitemCatController
{
	@Resource
	private TbItemCatService tbItemCatService;
	//树形结构 第一次的默认值是0代表的每个分类的根节点
	@RequestMapping("item/cat/list")
	@ResponseBody
	public List<EasyUiTree> showCat(@RequestParam(name="id",defaultValue="0") long id)
	{
		return this.tbItemCatService.selCatByParentId(id);
	}

}
